/**
 * @功能描述: 抽屉框组件
 * @author: lzn
 * @date: 2022-09-30 14:51:00
 * @version: 1.0
 */
<script setup>
import { onUpdated } from 'vue';

const props = defineProps(['open', 'placement', 'onClose', 'title']);

</script>

<template>
  <div 
    class="yw-drawer"
    v-if="props.open"
  >
    <div class="yw-drawer-mask" @click="props.onClose"></div>
    <div class="yw-drawer-content" :class="'yw-drawer-content-' + props.placement">
      <div class="yw-drawer-header">
        <svg class="yw-base-icon" aria-hidden="true" @click="props.onClose">
          <use xlink:href="#g-close"></use>
        </svg>
        <div>{{ props.title }}</div>
      </div>
      <div class="yw-drawer-body">
        <slot />
      </div>
    </div>
  </div>
</template>

<style scoped>

</style>